package yl.hs.bmipfull.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import yl.hs.bmipfull.security.HostHandler;
import yl.hs.bmipfull.service.production.IProductionLineService;

/**
 * InterceptorConfig
 * @category
 * @author 谢景广
 * @date 2021-11-17
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    IProductionLineService lineService;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration appReg = registry.addInterceptor(new HostHandler(lineService));
        appReg.addPathPatterns("/host/**");
        //appReg.excludePathPatterns("/erp/**","/swagger**/**","/login/**","/v3/**");
        //InterceptorRegistration erpReg = registry.addInterceptor(new ErpInterceptor());
        //erpReg.addPathPatterns("/erp/**");*/
    }
}
